#include "projeca.hpp"

int main( int argc, char** argv)
{
	std::string file_list_name;
	boost::gregorian::date start_date, 
		end_date;

	for(int i=1; i < argc ; i++)
	{
		if(argv[i][0] == '-') 
		{
			switch(argv[i][1])
			{
				case 'f': 
					file_list_name = argv[i+1];
					break;
				case 's': 
					start_date = date_input_string::to_date(argv[i+1]); 
					//std::cout <<"[main] START DATE = "<< start_date << std::endl; 
					break;
				case 'e':
					end_date = date_input_string::to_date(argv[i+1]);
					//std::cout << "[main] END DATE = " <<end_date << std::endl; 
					break;
				default: break;
			}
		}
	}

	if(!file_list_name.length()) return 1;
	
	file_list list(file_list_name);

//	car_maintenance_csv r(CAR_MAINTENANCE_FILE);
//	daily_travelling_allowance_type_csv r(DAILY_TRAVELLING_ALLOWANCE_TYPE_FILE);
//	travelling_type_csv r(TRAVELLING_TYPE_FILE);
//	comment_identifier_csv r(COMMENT_IDENT_FILE);
	boost::gregorian::date	a(2008,3,13), b(2008,12,30);

// [km, liter, money, estimated_fuel_consumption, mean_fuel_consumption, travel_on_business_estimated_fuel_consumption_liters, travel_on_business_estimated_fuel_consumption_money, travelling_fuel_refund, estimated_net_fuel_refund]

// data, progetto, km, tariffa, importo, percorso

	projeca::travelling(start_date, end_date);

	projeca::fuel_physical(start_date, end_date);

	projeca::fuel_financial(start_date, end_date);

	projeca::mean_fuel_consumption(start_date, end_date);

//	projeca::estimated_fuel_consumption(start_date);

	projeca::mean_fuel_distance(start_date, end_date);

	projeca::travelling_estimated_fuel_consumption_physical(start_date, end_date);

	projeca::travelling_estimated_fuel_consumption_financial(start_date, end_date);

	projeca::travelling_fuel_refund(start_date, end_date);
	
	projeca::travelling_estimated_net_fuel_refund(start_date, end_date);
	
//	projeca::kilometer_report(start_date, end_date);
	projeca::kilometer_report_in_period(start_date, end_date);

	projeca::report_expenses(start_date, end_date);


  	return 0;
}
